import request from '@/utils/request'


export interface LoginParamsData {
  username:string,
  password:string
}

interface TokenData {
  token:string
}
export interface UserInfoData {
  name:string,
  avatar:string,
  buttons:string[],
  routes:string[],
  roles:string[]
}

export default {
  // GET /admin/acl/index/info
  // info
  getUserInfo(){
    return request.get<any,UserInfoData>('/admin/acl/index/info')
  },


  // POST /admin/acl/index/login
  // login
  userLogin(loginParams:LoginParamsData){
    return request.post<any,TokenData>('/admin/acl/index/login',loginParams)
  },

  // POST /admin/acl/index/logout
  userLogout(){
    return request.post<any,null>('/admin/acl/index/logout')
  }
}